package ComputerOrganization.ComputerOrganizationWithInterface;

/**
 * @Author maojiangyue
 * @Date 2025/10/22
 * @Description 主程序类
 */
public class ComputerPowerOn {
    public static void main(String[] args) {
        Computer computer = new Computer();

        //没装入组件时
        computer.powerOn();

        //装入组件
        System.out.println("\n=== 测试散片CPU 内存 硬盘 ===");
        computer.setCpu(new CpuChip());
        computer.setMemory(new CJMemory());
        computer.setHardDisk(new SamsungHardDisk());
        computer.powerOn();

        //装入集成件
        System.out.println("\n=== 测试集成件 ===");
        ModularComponents modularComponent = new ModularComponents();
        computer.setCpu(modularComponent);
        computer.setMemory(modularComponent);
        computer.setHardDisk(modularComponent);
        computer.powerOn();
    }
}
